<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div>
        <img src="../imgs/a1.png" id="img_">

    </div>


    <script>
        var img = document.getElementById("img_").src = "../imgs/a" + window.setInterval(rotation, 1000) + ".png";
        var count = 1;

        function rotation() {
            count++;
            img.scr = "../imgs/a" + count + ".png";
            if (count == 3) {
                count = 1;
            }
        }
        window.setInterval(rotation, 1000)
    </script>
</body>

</html>